<!DOCTYPE html>
<html class='no-js' lang='en'>
  <head>
    <meta charset='utf-8'>
    <meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'>
    <title>密室逃脱后台管理登录</title>
    <link href="css/application.css" rel="stylesheet" type="text/css" />
    <link href="css/font-awesome.min.css" rel="stylesheet" type="text/css" />   
    <link href="css/main.css" rel="stylesheet" type="text/css">
    <link href="css/uploader.css" rel="stylesheet" type="text/css" />
  </head>
  <body class='login'>
    <div class='wrapper'>
      <div class='row'>
        <div class='col-lg-12'>
          <div class='brand text-center'>
            <h1>
              <div class='logo-icon'>
                <i class='fa fa-bank (alias)' style="color:#fff"></i>
              </div>
               密室逃脱
            </h1>
          </div>
        </div>
      </div>
      <div class='row'>
        <div class='col-lg-12'>
          <form id="form-login">
            <fieldset class='text-center'>
              <legend></legend>
              <div class='form-group'>
                <input class='form-control validate[required]' value="admin" name="loginId" data-errormessage-value-missing="请输入登录ID" placeholder='请输入登录ID' type='text'>
              </div>
              <div class='form-group'>
                <input class='form-control validate[required]' value="888888" name="password" data-errormessage-value-missing="请输入登录密码" placeholder='请输入登录密码' type='password'>
              </div>
              <div class='text-center'>
                <div class='checkbox'>
                  <label><input type='checkbox'>记住密码</label>
                </div>
                <a class="btn btn-default" onclick="login()">登录</a>
              </div>
            </fieldset>
          </form>
        </div>
      </div>
    </div>
    <!-- Footer -->
    <!-- Javascripts -->
    <script src="js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="js/main.js"></script>
    <script src="js/jquery.validationEngine.min.js"></script>
    <script src="js/jquery.validationEngine-zh_CN.js" charset="utf-8"></script>
    <script src="js/toastr.min.js"></script>
    <script src="js/doT.min.js"></script>
    <script type="text/javascript">
      $(function() {
        $("#form-login").validationEngine({
          promptPosition : 'topRight:-30',
          addPromptClass : 'formError-noArrow',
          maxErrorsPerField : 1
        });
        $("input").keydown(function(e) {
          e = e || event;
          if (e.keyCode == 13) {
            login();
            return false;
          }
        });
      });
      function login(){
        globalVariable.lock=true;
        if ($("#form-login").validationEngine('validate')&& globalVariable.lock) {
          globalVariable.lock=false;
          var para = $("#form-login").formToJson();

          callSvr("shop/login",para,function(data){
            globalVariable.lock=true;
            if(data.err==1){
              toastr.error('不存在该帐号！','');
              return;
            }else if(data.err==3){
              toastr.error('该帐号被禁用！','');
              return;
            }else if(data.err==2){
              toastr.error('密码错误！','');
              return;
            }else if(data.err==0){
              window.location.href="index.html";
            }else{
              toastr.error('未知错误！','');
              return;
            }
          });
        }
      }
    </script>
  </body>
</html>
